<html>
<head><meta charset="utf-8"><title>GOLang to RUST Re-engineering · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/GOLang.20to.20RUST.20Re-engineering.html">GOLang to RUST Re-engineering</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="181042844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/GOLang%20to%20RUST%20Re-engineering/near/181042844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Leonard Edwin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/GOLang.20to.20RUST.20Re-engineering.html#181042844">(Nov 18 2019 at 18:37)</a>:</h4>
<p>Hello, I have a large Blockchain CONSENSUS module written in GO that  I would like to 're-engineer' to RUST code, only because I have very little RUST programming knowledge and experience.  Is there a GO-RUST COMPILER or proven PROCESS to achieve the conversion of GOLang code into RUST?  Many Thanks :)</p>



<a name="181047626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/GOLang%20to%20RUST%20Re-engineering/near/181047626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/GOLang.20to.20RUST.20Re-engineering.html#181047626">(Nov 18 2019 at 19:29)</a>:</h4>
<p>I think that Go is a sufficiently complicated language that you'd need to do it by hand. Even the automatic C to Rust compiler isn't perfect.</p>



<a name="181051015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/GOLang%20to%20RUST%20Re-engineering/near/181051015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/GOLang.20to.20RUST.20Re-engineering.html#181051015">(Nov 18 2019 at 20:08)</a>:</h4>
<p>You may also wish to re-evaluate when to use all-capital letters. Generally considered to be yelling when communicating online. It's correctly written as Go and Rust.</p>



<a name="181051537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/GOLang%20to%20RUST%20Re-engineering/near/181051537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Leonard Edwin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/GOLang.20to.20RUST.20Re-engineering.html#181051537">(Nov 18 2019 at 20:15)</a>:</h4>
<p>Hi Everyone, thanks for your very valuable feedback ! <span class="user-mention" data-user-id="224471">@Lokathor</span> I'd appreciate if you could point me to where/how I can evaluate the 'automatic C to Rust compiler' to become familiar with the process ...many Thanks :)</p>



<a name="181051667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/GOLang%20to%20RUST%20Re-engineering/near/181051667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/GOLang.20to.20RUST.20Re-engineering.html#181051667">(Nov 18 2019 at 20:16)</a>:</h4>
<p><a href="https://github.com/jameysharp/corrode" target="_blank" title="https://github.com/jameysharp/corrode">https://github.com/jameysharp/corrode</a></p>
<p>I'm not sure if there are other attempts</p>



<a name="181052869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/GOLang%20to%20RUST%20Re-engineering/near/181052869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yerkebulan Tulibergenov <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/GOLang.20to.20RUST.20Re-engineering.html#181052869">(Nov 18 2019 at 20:32)</a>:</h4>
<p><a href="https://github.com/immunant/c2rust" target="_blank" title="https://github.com/immunant/c2rust">https://github.com/immunant/c2rust</a></p>



<a name="181054490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/GOLang%20to%20RUST%20Re-engineering/near/181054490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/GOLang.20to.20RUST.20Re-engineering.html#181054490">(Nov 18 2019 at 20:53)</a>:</h4>
<p>Is there an automatic Go-to-C tool? You could hook both of them up to produce terrible output.</p>



<a name="181054505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/GOLang%20to%20RUST%20Re-engineering/near/181054505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/GOLang.20to.20RUST.20Re-engineering.html#181054505">(Nov 18 2019 at 20:53)</a>:</h4>
<p>I wonder if you could compile to WASM and then disassemble...</p>



<a name="181182991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/GOLang%20to%20RUST%20Re-engineering/near/181182991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/GOLang.20to.20RUST.20Re-engineering.html#181182991">(Nov 20 2019 at 06:23)</a>:</h4>
<p>Honestly, you're not going to get good results from any automated conversion. You're going to need to translate the code by hand.</p>



<a name="188095585"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/GOLang%20to%20RUST%20Re-engineering/near/188095585" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Elichai Turkel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/GOLang.20to.20RUST.20Re-engineering.html#188095585">(Feb 13 2020 at 10:57)</a>:</h4>
<p>Yep. Most automatic conversions produce UB results.<br>
As the invariants of unsafe rust are more strict than those of C</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>